package com.runa.protocol.enums;

/**
 * dtu型号
 */
public enum DtuModel {
	/**
	 * 宏电
	 */
	HongDian7710(0),
	/**
	 * 天津dtu86
	 */
	Dtu86(1),
	/**
	 * 厦门才茂
	 */
	CaimorePort(2),

	/**
	 * 济南有人G780
	 */
	URG780(3);

	private int type;

	DtuModel(int type){
	this.type = type;
}


	public static DtuModel valuesOf(String values) throws Exception{
		switch (values) {
			case "50":
				return HongDian7710;
			case "86":
				return Dtu86;
			case "87":
				return CaimorePort;
			default:
				throw new Exception("dtu protocol model err!");
		}
	}

	public int getType() {
		return type;
	}
}
